

#include "allreduce.h"

namespace ai_sim
{
AllreduceAlgorithm* AllreduceAlgorithm::get(TaskType type) {
    if (type == RingAllreduce) {
        return new RingAllreduceAlgorithm();
    } else if (type == Butterfly) {
        return new ButterflyAlgorithm();
    } else {
        throw omnetpp::cRuntimeError("DONT SUPPORT THE TASK TYPE");
        return nullptr;
    }
}
}  // namespace ai_sim
